package com.fenghongzhang.day10matrix;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {
    private Button btn;
    private MyView myView;
    private Button btn1;
    private Button btn2;
    private Button btn3;
    private Button btn4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        btn = (Button) findViewById(R.id.btn);
        myView = (MyView) findViewById(R.id.myView);

        btn1 = (Button) findViewById(R.id.btn1);

        btn2 = (Button) findViewById(R.id.btn2);
        btn3 = (Button) findViewById(R.id.btn3);
        btn4 = (Button) findViewById(R.id.btn4);


        btn.setOnClickListener( v -> {
            myView.scale(2,2);
        });

        btn1.setOnClickListener(v -> {
            myView.setTranslate(100,100);
        });

        btn2.setOnClickListener(v -> {
            myView.setTotate(180,50,50);
        });

        btn3.setOnClickListener(v -> myView.setSkew(0,1));


        btn4.setOnClickListener(v -> myView.mark());
    }
}
